

package cn.nubia.admin.application.bean;

import cn.nubia.admin.common.mybatis.annotations.Column;
import cn.nubia.admin.common.mybatis.annotations.Id;
import cn.nubia.admin.common.mybatis.annotations.Table;
import cn.nubia.admin.common.mybatis.annotations.UnColumn;
import cn.nubia.admin.file.FileManager;

import java.io.Serializable;

/**
 * Created by justin on 15/6/30.
 *  CREATE TABLE `nb_screenshot` (
 `screen_id` int(11) NOT NULL AUTO_INCREMENT COMMENT '截图id',
 `screen_url` varchar(200) DEFAULT NULL COMMENT '截图url',
 `sort_index` int(11) DEFAULT NULL COMMENT '排序号',
 `create_time` int(11) DEFAULT NULL COMMENT '创建时间',
 `screen_name` varchar(100) DEFAULT NULL COMMENT '截图名称',
 `screen_size` int(11) DEFAULT NULL COMMENT '截图大小（字节）',
 `screen_width` int(11) DEFAULT NULL COMMENT '截图宽度',
 `screen_height` int(11) DEFAULT NULL COMMENT '截图高度',
 `is_delete` tinyint(4) DEFAULT NULL COMMENT '是否删除（1：删除 0：正常）',
 `soft_item_id` int(11) DEFAULT NULL COMMENT '软件版本编号',
 PRIMARY KEY (`screen_id`)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='软件截图表';

 SET FOREIGN_KEY_CHECKS = 1;
 */
@Table(value = "nb_screenshot")
public class ScreenShot implements Serializable{


    private static final long serialVersionUID = -8244661101951482489L;

    public static final String COLUMN_SOFTITEMID = "softItemId";
    public static final String COLUMN_SORTINDEX = "sortIndex";



    @Id(value = "screen_id")
    private Integer id;
    @Column(value = "screen_url")
    private String screenUrl;//截图url
    @Column(value = "sort_index")
    private Integer sortIndex;
    @Column(value = "create_time")
    private Integer createTime;
    @Column(value = "screen_name")
    private String screenName;//截图名称
    @Column(value = "screen_size")
    private Integer screenSize;//截图大小（字节）
    @Column(value = "screen_width")
    private Integer screenWidth;//截图宽度
    @Column(value = "screen_height")
    private Integer screenHeight;//截图高度
    @Column(value = "is_delete")
    private Integer isDelete;
    @Column(value = "soft_item_id")
    private Integer softItemId;//软件版本编号
    @UnColumn
    private String localScreenshotUrl;//本地

    public void initScreenshotPath(){
        String screenshotPath = FileManager.getLocalDir(FileManager.ABSPATH_SCREENSHOT);
        this.setLocalScreenshotUrl(screenshotPath + System.currentTimeMillis() + ".png");
        this.setScreenUrl(FileManager.getAbsFile(this.getLocalScreenshotUrl()));
    }


    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getScreenUrl() {
     return screenUrl;
    }

    public void setScreenUrl(String screenUrl) {
     this.screenUrl = screenUrl;
    }

    public Integer getSortIndex() {
     return sortIndex;
    }

    public void setSortIndex(Integer sortIndex) {
     this.sortIndex = sortIndex;
    }

    public Integer getCreateTime() {
     return createTime;
    }

    public void setCreateTime(Integer createTime) {
     this.createTime = createTime;
    }

    public String getScreenName() {
     return screenName;
    }

    public void setScreenName(String screenName) {
     this.screenName = screenName;
    }

    public Integer getScreenSize() {
     return screenSize;
    }

    public void setScreenSize(Integer screenSize) {
     this.screenSize = screenSize;
    }

    public Integer getScreenWidth() {
     return screenWidth;
    }

    public void setScreenWidth(Integer screenWidth) {
     this.screenWidth = screenWidth;
    }

    public Integer getScreenHeight() {
     return screenHeight;
    }

    public void setScreenHeight(Integer screenHeight) {
     this.screenHeight = screenHeight;
    }

    public Integer getIsDelete() {
        return isDelete;
    }

    public void setIsDelete(Integer isDelete) {
        this.isDelete = isDelete;
    }

    public Integer getSoftItemId() {
     return softItemId;
    }

    public void setSoftItemId(Integer softItemId) {
     this.softItemId = softItemId;
    }

    public String getLocalScreenshotUrl() {
        return localScreenshotUrl;
    }

    public void setLocalScreenshotUrl(String localScreenshotUrl) {
        this.localScreenshotUrl = localScreenshotUrl;
    }
}
